﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ajax;
using SeDuce.Utility;
using SeDuce.BLL;

public partial class site : System.Web.UI.MasterPage
{
    Lazy_Yu<ArticleBLL> lazyArticleBLL = new Lazy_Yu<ArticleBLL>(() => new ArticleBLL());
    public ArticleBLL LazyArticleBLL
    {
        get { return this.lazyArticleBLL.Value; }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        Ajax.Utility.RegisterTypeForAjax(typeof(site));

        List<SeDuce.Model.Article> articles = this.LazyArticleBLL.GetArticleByType((int)(Misc.ArticleTypeEnum)Enum.Parse(typeof(Misc.ArticleTypeEnum), "支付信息说明", true)).ToList<SeDuce.Model.Article>();
        if (articles.Count > 0)
        {
            this.literContent.Text = articles.SingleOrDefault().ContentText;
        }

    }
    protected void lbtnJP_Click(object sender, EventArgs e)
    {
        this.Session[Utils.SESSIONPREFERREDCULTURE] = "ja-JP";
        Response.Redirect(Request.Url.PathAndQuery);
    }
    protected void lbtnEn_Click(object sender, EventArgs e)
    {
        this.Session[Utils.SESSIONPREFERREDCULTURE] = "en-US";
        Response.Redirect(Request.Url.PathAndQuery);
    }
    protected void lbtnCN_Click(object sender, EventArgs e)
    {
        this.Session[Utils.SESSIONPREFERREDCULTURE] = "zh-CN";
        Response.Redirect(Request.Url.PathAndQuery);
    }

    [Ajax.AjaxMethod()]
    public string BuildKeyWord(string input)
    {
        try
        {
            return SeDuce.Utility.DESEncrypt.EncryptQueryString(SeDuce.Utility.Utils.FullTextSearchStringGenerator(input));
        }
        catch { return null; }
    }
}
